<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <%@include file="../../resources/inc/head.jsp" %>
    <style>
        .layui-layout-admin .layui-header .layui-nav .layui-this:after, .layui-layout-admin .layui-header .layui-nav-bar {
            height: 2px;
            background-color: #5FB878;
        }
        @media screen and (max-width: 1080px) {
            .mobileTopLevelMenus[mobile] {
                display: inline-block;
            }
            .mobileTopLevelMenus .layui-nav-item{
                width: 140px;
                text-align: center;
                margin: 0px !important;
            }
            .site-mobile .site-tree-mobile, .topLevelMenus[pc] {
                display: none !important;
            }
        }
        @media screen and (min-width: 1080px) {
            .mobileTopLevelMenus[mobile] {
                display: none !important;
            }
            .site-mobile .site-tree-mobile, .topLevelMenus[pc] {
                display: inline-block;
            }
        }
        .layui-layout-admin .layui-header .layui-nav .layui-nav-child dd.layui-this, .layui-layout-admin .layui-header .layui-nav .layui-nav-child dd.layui-this a {
            background-color: #5FB878;
            color: #fff;
        }

    </style>
</head>
<body class="layui-layout-body">

<div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item layadmin-flexible" lay-unselect>
                    <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                        <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                    </a>
                </li>
                <li class="layui-nav-item" lay-unselec style="margin: 0px">
                    <ul class="layui-nav topLevelMenus" pc="" style="padding: 0px">
                        <c:forEach items="${permissionSystems}" var="permissionSystem" varStatus="status">
                            <li class="layui-nav-item switch-systems switch-systems_${permissionSystem.id}" lay-unselect
                                systemid="${permissionSystem.id}" systemname="${permissionSystem.name}"
                                systemtitle="${permissionSystem.title}">
                                <a style="cursor: pointer" lay-text="${permissionSystem.description}">
                                    <i class="${permissionSystem.icon}"></i>
                                        ${permissionSystem.title}</a>
                            </li>
                        </c:forEach>
                        <span class="layui-nav-bar" style="left: 137px; top: 45px; width: 0px; opacity: 0;"></span>
                    </ul>
                    <ul class="layui-nav mobileTopLevelMenus" mobile=""  style="padding: 0px">
                        <li class="layui-nav-item">
                            <a href="javascript:;">
                                <cite id="system_title_nav">网站设置</cite>
                            </a>
                            <dl class="layui-nav-child">
                                <c:forEach items="${permissionSystems}" var="permissionSystem" varStatus="status">
                                    <dd class="switch-systems switch-systems_${permissionSystem.id}" lay-unselect
                                        systemid="${permissionSystem.id}" systemname="${permissionSystem.name}"
                                        systemtitle="${permissionSystem.title}">
                                        <a style="cursor: pointer" lay-text="${permissionSystem.description}">
                                            <i class="${permissionSystem.icon}"></i>
                                                ${permissionSystem.title}</a>
                                    </dd>
                                </c:forEach>
                            </dl>
                        </li>

                        <li class="layui-nav-item layui-hide-xs" lay-unselect>
                            &nbsp;
                        </li>
                    </ul>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right" style="margin-right: 20px">
                <li class="layui-nav-item topLevelMenus" pc="">
                    <a href="javascript:;" layadmin-event="refresh" title="刷新">
                        <i class="layui-icon layui-icon-refresh-3"></i>
                    </a>
                </li>
                <li class="layui-nav-item topLevelMenus" pc="">
                    <a href="javascript:;">
                        <img src="${sessionScope.permissionUser.avatar}" class="layui-nav-img userAvatar" width="35" height="35">
                        <cite>${sessionScope.permissionUser.userName}</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a lay-href="<%=basePath%>manager/permission/user/personData/${sessionScope.permissionUser.id}.action">基本资料</a>
                        </dd>
                        <dd><a lay-href="<%=basePath%>manager/permissionUser/alterPassword.html">修改密码</a></dd>

                    </dl>
                </li>

                <li class="layui-nav-item"><a href="javascript:;" layadmin-event="logout" id="logoutid"><i class="layui-icon  layui-icon-spread-left" aria-hidden="true"></i> 注销</a></li>
            </ul>
        </div>
        <%@include file="../../resources/inc/nav.jsp" %>
        <!-- 页面标签 -->
        <div class="layadmin-pagetabs" id="LAY_app_tabs">
            <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-down">
                <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;"></a>
                        <dl class="layui-nav-child layui-anim-fadein">
                            <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                            <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                            <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
            <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                <ul class="layui-tab-title" id="LAY_app_tabsheader">
                    <li lay-id="<%=nav_basePath%>manager/console.html"
                        lay-attr="<%=nav_basePath%>manager/console.html" class="layui-this"><i
                            class="layui-icon layui-icon-home"></i></li>
                </ul>
            </div>
        </div>


        <!-- 主体内容 -->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show">
                <iframe src="<%=basePath%>manager/console.html" frameborder="0" class="layadmin-iframe"></iframe>
            </div>
        </div>

        <!-- 辅助元素，一般用于移动设备下遮罩 -->
        <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
</div>
<%@include file="../../resources/inc/footer.jsp" %>
<script>
    layui.config({
        base: '<%=basePath%>resources/lib/layuiAdmin/' //静态资源所在路径
    }).extend({

        index: 'lib/index' //主入口模块
    }).use(['index'], function () {

        $ = layui.jquery;


        var $ = layui.$;
        $('.switch-systems').click(function () {
            var systemid = $(this).attr('systemid');
            var systemname = $(this).attr('systemname');
            var systemtitle = $(this).attr('systemtitle');
            $('.system_menus').hide(0, function () {
                $('.system_' + systemid).show();
            });
            $('.switch-systems').removeClass("layui-this");
            $('.switch-systems_' + systemid).addClass("layui-this");
            $('body').attr("id", systemname);
            $('#system_title').text(systemtitle);
            $('#system_title_nav').text(systemtitle);
            cookie.set("expectx-systemid", systemid, 1);
            cookie.set("expectx-systemname", systemname, 1);
            cookie.set("expectx-systemtitle", systemtitle, 1);
        });
        var systemid = cookie.get('expectx-systemid') || 1;
        var systemname = cookie.get('expectx-systemname') || 'titifootball-upms-server';
        var systemtitle = cookie.get('expectx-systemtitle') || 'E-XPay聚合支付平台';
        $('.system_menus').hide(0, function () {
            $('.system_' + systemid).show();
        });
        $('.switch-systems').removeClass("layui-this");
        $('.switch-systems_' + systemid).addClass("layui-this");
        $('body').attr('id', systemname);
        $('#system_title').text(systemtitle);
        $('#system_title_nav').text(systemtitle);
    });
    var cookie = {
        set: function (key, val, time) {//设置cookie方法
            var date = new Date(); //获取当前时间
            var expiresDays = time;  //将date设置为n天以后的时间
            date.setTime(date.getTime() + expiresDays * 24 * 3600 * 1000); //格式化为cookie识别的时间
            document.cookie = key + "=" + val + ";expires=" + date.toGMTString();  //设置cookie
        },
        get: function (key) {//获取cookie方法
            /*获取cookie参数*/
            var getCookie = document.cookie.replace(/[ ]/g, "");  //获取cookie，并且将获得的cookie格式化，去掉空格字符
            var arrCookie = getCookie.split(";")  //将获得的cookie以"分号"为标识 将cookie保存到arrCookie的数组中
            var tips;  //声明变量tips
            for (var i = 0; i < arrCookie.length; i++) {   //使用for循环查找cookie中的tips变量
                var arr = arrCookie[i].split("=");   //将单条cookie用"等号"为标识，将单条cookie保存为arr数组
                if (key == arr[0]) {  //匹配变量名称，其中arr[0]是指的cookie名称，如果该条变量为tips则执行判断语句中的赋值操作
                    tips = arr[1];   //将cookie的值赋给变量tips
                    break;   //终止for循环遍历
                }
            }
            return tips;
        },
        delete: function (key) { //删除cookie方法
            var date = new Date(); //获取当前时间
            date.setTime(date.getTime() - 10000); //将date设置为过去的时间
            document.cookie = key + "=v; expires =" + date.toGMTString();//设置cookie
        }
    }
</script>


</body>
</html>


